﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html;charset=UTF-8"%>
<%@page import="com.hoperun.application.VideoServerInfo"%>
<%@page import="java.util.Map"%>
<%
	Map pmap = (Map) config.getServletContext().getAttribute("hmap"); 
	String point = request.getParameter("q_checkpoint");
	String videoid  = "";
	if(pmap.containsKey(point)){
		 videoid = (String)pmap.get(point);
	}
String kj = request.getParameter("kssj");
String jj = request.getParameter("jssj");
VideoServerInfo vi = (VideoServerInfo) config.getServletContext().getAttribute("historyVideo"); 
%>

<html>
	<head>
		<title>回放录像</title>
		<style type="text/css">
div,td,input {
	font-size: 12px;
}

.ptzBtn {
	width: 32px;
}

#Select1 {
	width: 126px;
	height: 22px;
}

#SelectWnd {
	width: 70px;
}
</style>

		<SCRIPT>
    /*****设置本地参数******/
    function SetlocalParam()
    {
        var OCXobj = document.getElementById("PlayBackOCX");
        PicType = document.getElementById("SelectPicType").value;
        PicPath = document.getElementById("TextPicPath").value;
        RecordPath = document.getElementById("TextRecordPath").value;
        strXML = "<?xml version='1.0'?><Parament><CappicMode>"+ PicType +"</CappicMode><CappicPath>"+ PicPath +"</CappicPath><CutPath>"+ RecordPath +"</CutPath><CutFileSize>2</CutFileSize></Parament>";
        OCXobj.SetLocalParam(strXML);
    }
    
    /*****设置回放参数******/
    function SetPlayBackParam()
    {
        var OCXobj = document.getElementById("PlayBackOCX");
        var WndIndex = OCXobj.GetFocusWndIndex();//获取当前选中窗口
        ZoneID = document.getElementById("TextZoneID").value;
        RecLocation = document.getElementById("SelectRecLocation").value;
        DevType = document.getElementById("SelectDevType").value;
        CameraID = document.getElementById("TextCameraID").value;
        CameraName = document.getElementById("TextCameraName").value;
        VRMUrl = document.getElementById("TextVRMURL").value;
        strXML = "<?xml version='1.0'?><Parament><PlayWndIndex>"+WndIndex+"</PlayWndIndex><ZoneID>"+ZoneID+"</ZoneID><RecLocation>"+RecLocation+"</RecLocation><DevType>"+DevType+"</DevType><CameraID><%=videoid%></CameraID><CameraName>"+CameraName+"</CameraName><VRMUrl>vrm://<%=vi.getIp()%>:<%=vi.getPort()%></VRMUrl></Parament>";
        OCXobj.SetPlayBackParam(strXML);
    }
    /*****搜索录像******/
    function StartQueryRecord()
    {
        var OCXobj = document.getElementById("PlayBackOCX");
        StartTime = document.getElementById("TextStartTime").value;
        EndTime = document.getElementById("TextEndTime").value;
        RecType = document.getElementById("TextRecType").value;
        strXML = "<?xml version='1.0'?><Parament><BeginTime>"+StartTime+"</BeginTime><EndTime>"+EndTime+"</EndTime><RecordType>"+RecType+"</RecordType></Parament>";
        OCXobj.StartQueryRecord(strXML);
    }
    
    function StartDownload()
    {
        var OCXobj = document.getElementById("PlayBackOCX");
        StartTime = document.getElementById("startTime").value;
        EndTime = document.getElementById("endTime").value;
        OCXobj.StartDownloadEx(StartTime,EndTime);
    }
      
    </SCRIPT>

		<!-- 以下是事件触发函数接口 -->
		<script language="javascript" for="PlayBackOCX"
			event="FireStartPlayBack(iSel)">
szMsg = "回放成功,回放窗口:" + iSel;
//alert(szMsg );
</script>

		<script language="javascript" for="PlayBackOCX"
			event="FireStopPlayBack(iSel)">
szMsg = "停止回放成功,停止窗口:" + iSel;
//alert(szMsg);
</script>


		<script language="javascript">
function fff() {
	SetPlayBackParam();
	StartQueryRecord();
}
</script>

	</head>
	<style>
* {
	margin: 0 auto;
	padding: 0;
	border: 0;
}
</style>
	<body onload="fff();">

		<input id="Hidden1" type="hidden" />
		<!--  开始时间-->
		<input id="TextStartTime" type="hidden" value="<%=kj %>" />
		<!--  结束时间-->
		<input id="TextEndTime" type="hidden" value="<%=jj %>" />
		<!--  录像类型-->
		<input id="TextRecType" type="hidden" value="23" />


		<!--  网域ID-->
		<input id="TextZoneID" type="hidden" value="2" />
		<!-- 录像位置 -->
		<!-- <td width="75%"><select style="width:130px" id="SelectRecLocation" name="D4">
                    <option value = "0">IPSAN</option>
                    <option value = "1">DVR</option>
                    <option value = "2" selected>NVR</option>
                </select></td> -->
		<input type="hidden" id="SelectRecLocation" name="D4" value="2" />
		<!--  设备类型
                <td width="75%">
                    <select style="width:130px" id="SelectDevType" name="D3">
                    <option value = "0" selected>海康</option>
                    <option value = "1">大华</option>
                </select></td>-->
		<input type="hidden" id="SelectDevType" name="D3" value="0" />
		<!--  监控点ID-->
		<input id="TextCameraID" type="hidden" value="<%=point %>" />
		<!-- 监控名字 -->
		<input id="TextCameraName" type="hidden" value="Camera 01" />
		<!--  VRM地址-->
		<input id="TextVRMURL" type="hidden" value="58.213.116.34" />
		<!--  抓图格式
                                <td width="60%" align="center"><select style="width:130px" id="SelectPicType">
                                    <option value = "0" selected>JPEG</option>
                                    <option value = "1">BMP</option>
                                    </select></td>-->
		<input type="hidden" id="SelectPicType" value="0" />
		<!--抓图路径-->
		<input id="TextPicPath" type="hidden"
			value="C:\Hikvision\Snapshot\playBack\" />
		<!--剪辑路径-->
		<input id="TextRecordPath" type="hidden" value="C:\Hikvision\Clip\" />
		<!--  开始时间-->
		<input id="startTime" type="hidden" value="2010-12-01 18:00:00" />
		<!--  结束时间-->
		<input id="endTime" type="hidden" value="2010-12-31 18:30:00" />



		<!-- 添加预览控件（需要先在windows下注册） -->
		<object classid="clsid:61978326-6772-4595-9EC3-D23C5CD5E61F"
			id="PlayBackOCX" width="100%" height="100%" align="middle" name="ocx">
		</object>


	</body>
</html>

